<?
include("includes/config.inc.php");
include("includes/auth.lib.php");
include("includes/function.inc.php");
include("includes/product_new.class.php");
$elenco = category::getChild(2,"0");
//die($elenco);
//$qry = "SELECT * FROM articoli_new WHERE cid IN ($elenco) and giardino=1 and import=0;";
//die($qry);
$qry = "select cid,url from tmp_url_categorie;";
$rs = esegui_queryRs($qry);
$arrCat1 = array();
$arrCat2 = array();
while(!$rs->EOF) {
	$arrCat1[$rs->Fields("cid")] = $rs->Fields("url");
	$rs->MoveNext();
}
$rs->Close();
$qry = "select cid,hidden as url from categorie_old;";
$rs = $conn->Execute($qry);
if($rs->RecordCount()>0) {
	$i = 0;
	$num = $rs->RecordCount();
	$error = "OK";
	while(!$rs->EOF) {
		$arrCat2[$rs->Fields("cid")] = $rs->Fields("url");
		//$permalink = strPermalink(utf8_encode($rs->Fields("titolo1")));
		//$conn->Execute("update articoli_new set hidden='".$permalink."' where idarticolo=".$rs->Fields("idarticolo").";");
		//echo "update articoli_new set hidden='".$permalink."' where idarticolo=".$rs->Fields("idarticolo").";<br>";
		/*
		if(!file_exists("imgs_prodotti/".$rs->Fields("idarticolo")."/".$rs->Fields("image_tmb")))
		  echo "imgs_prodotti/".$rs->Fields("idarticolo")."/".$rs->Fields("image_tmb")."<br>";
		if(!file_exists("imgs_prodotti/".$rs->Fields("idarticolo")."/".$rs->Fields("image")))
		  echo "imgs_prodotti/".$rs->Fields("idarticolo")."/".$rs->Fields("image")."<br>";
		if(!file_exists("imgs_prodotti/".$rs->Fields("idarticolo")."/".$rs->Fields("image_big")))
		  echo "imgs_prodotti/".$rs->Fields("idarticolo")."/".$rs->Fields("image_big")."<br>";
		 /*
		if(!file_exists("../immagini-piscine/".$rs->Fields("image_tmb")))
		  echo "../immagini-piscine/".$rs->Fields("image_tmb")."<br>";
		if(!file_exists("../immagini-piscine/".$rs->Fields("image")))
		  echo "../immagini-piscine/".$rs->Fields("image")."<br>";
		if(!file_exists("../immagini-piscine/".$rs->Fields("image_big")))
		  echo "../immagini-piscine/".$rs->Fields("image_big")."<br>";
		  */
		$rs->MoveNext();
	}
	$rs->Close();
}
foreach ($arrCat2 as $cid=>$url) {
	if($arrCat1[$cid]!=$arrCat2[$cid])
	  echo "$cid ".$arrCat2[$cid]."<br>";
}
//die($error);
?>